home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 0191.ZIP / PGM-AIDE.DVR < prev    next >
Text File  |  1985-09-29  |  3KB  |  83 lines

  1. {-------------------------------------------------------------------------}
  2. {                            PGM-AIDE.DVR                                 }
  3. {-------------------------------------------------------------------------}
  4. {                  Copyright 1985                                         }
  5. {                                 by Lynn A. Canning                      }
  6. {                                    9107 Grandview Dr.                   }
  7. {                                    Overland Park, Ks. 66212             }
  8. {                                                                         }
  9. {  This routine was placed in the public domain by the author             }
  10. {-------------------------------------------------------------------------}
  11.  
  12. Var
  13.  
  14.   ch                :char;
  15.   cx,cy             :byte;
  16.  
  17. {-------------------------------------------------------------------------}
  18. {                      Check for Printer Ready                            }
  19. {-------------------------------------------------------------------------}
  20.  
  21. procedure check_printer;
  22. begin
  23.     with regs do begin
  24.       ax := $02 shl 8;                   {Set for service 2}
  25.       dx := $0000;                       {Set printer number}
  26.       end;
  27.     Intr($17,regs);                      {invoke interrupt 23}
  28.     if halfregs.ah <> 144 then begin     {if not = 144 then printer not ready}
  29.       ch := ' ';
  30.       MkWin(26,12,54,18,2,4,0);
  31.       gotoxy(1,2);
  32.       Writeln(' Printer not ready');
  33.       Writeln(' Set up printer and retry');
  34.       TimeDelay(3);
  35.       RmWin;
  36.       end;
  37. end;
  38.  
  39. {-------------------------------------------------------------------------}
  40. {                     Display Program Aide Menu                           }
  41. {-------------------------------------------------------------------------}
  42.  
  43. procedure init_window;
  44. begin
  45.   MkWin(17,5,63,20,2,6,0);
  46.   ClrScr;
  47.   gotoxy(1,2);
  48.   Writeln('            Program Aide Menu');
  49.   Writeln;
  50.   Writeln(' (C) Copyright 1985                       ');
  51.   Writeln(' Version 1.00       by Lynn A. Canning');
  52.   Writeln;
  53.   Writeln;
  54.   Writeln('            1 = Screen Counter');
  55.   Writeln('            2 = Epson Window');
  56.   Writeln('            X = Exit');
  57.   Writeln;
  58.   Writeln('              Option Wanted ');
  59.   gotoxy(29,12);
  60.   Read(Kbd,ch);
  61.   if ch = quit_key then Stay_Xit;
  62.   if ch = '2' then
  63.     check_printer;
  64.   RmWin;
  65.   gotoxy(cx,cy);
  66.   end;
  67.  
  68. {-------------------------------------------------------------------------}
  69. {                              Main Program                               }
  70. {-------------------------------------------------------------------------}
  71.  
  72. begin
  73.   cx := wherex;
  74.   cy := wherey;
  75.   repeat init_window;
  76.     until (ch = '1') or (ch = '2') or (upcase(ch) = 'X');
  77.   gotoxy(cx,cy);
  78.   if ch = '1' then
  79.     SC
  80.   else
  81.     if ch = '2' then
  82.       EP;
  83. end;